import datetime
from typing import Optional

from sqlalchemy import String, Enum, ForeignKey, func, DateTime
from sqlalchemy.orm import mapped_column, Mapped

from app.web.models.BaseModel import Base, DeleteStatus


class JobSeeker(Base):
    __tablename__ = "job_seeker"
    name: Mapped[str] = mapped_column(String(30))
    age: Mapped[int] = mapped_column()

    def __repr__(self) -> str:
        return f"User(id={self.id!r}, name={self.name!r}"


class Resume(Base):
    __tablename__ = "resume"
    file_name: Mapped[str] = mapped_column(String(100))
    file_path: Mapped[str] = mapped_column(String(250))
    created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
    version: Mapped[int] = mapped_column(default=1)
    is_delete: Mapped[int] = mapped_column(Enum(DeleteStatus), default=DeleteStatus.EXISTING)
    job_seeker: Mapped[int] = mapped_column(ForeignKey("job_seeker.id"))

    def __repr__(self) -> str:
        return f"User(id={self.id!r}, name={self.file_name!r}, path={self.file_path!r}"
    pass




